package com.iantpi.blog.plugin.server;

import com.iantpi.plugin.api.Greeting;
import org.pf4j.DefaultPluginManager;
import org.pf4j.PluginManager;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.List;

@SpringBootApplication
public class PluginServerApplication {

    public static void main(String[] args) {
//        SpringApplication.run(PluginServerApplication.class, args);
        PluginManager pluginManager = new DefaultPluginManager();
        List<Greeting> greetings = pluginManager.getExtensions(Greeting.class);
        for (Greeting greeting : greetings) {
            System.out.println(">>> " + greeting.getGreeting());
        }

    }
}
